<?php


namespace app\api\validate;
use app\lib\exception\ParameterException;
use think\Validate;
use think\facade\Request;

class BaseValidate extends Validate
{
    public function goCheck () {
        $params = Request::param();
        if(!$this->check($params)) {
            $exception = new ParameterException([
              'msg' => is_array($this->error) ? implode(
                ';', $this->error) : $this->error
            ]);
            throw $exception;
        }
        return true;

    }
}